package com.msti.main;

import java.util.Date;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.msti.entity.Employee;
import com.msti.entity.Student;
import com.msti.service.LoginDAO;
import com.msti.service.LoginDAOImpl;
import com.msti.sessionMgt.ApplicationSession;
import com.msti.utility.JDBCCon;
import com.msti.utility.Utility;


public class Main {

	public static void main(String[] args) {
		//Utility.getUniqueId();
		//Utility.getUniqueId();
		//long a = Utility.getUniqueId();
		//System.out.println(a);
		//SessionFactory sessionFactory =	new Configuration().configure().buildSessionFactory();
		/*Date d = new Date();
		String s = Integer.toString(1900+d.getYear());
		s += Integer.toString(d.getMonth()+1);
		s += Integer.toString(d.getDate());
		System.out.println(s);
		//System.out.println(Utility.stringToDate("19-03-2012"));
		//JDBCCon.getConnection();
		
		StudentBatchCourse studentBatchCourse = new StudentBatchCourse();
		studentBatchCourse.setBatchId("fdf");
		studentBatchCourse.setCourseId(150);
		studentBatchCourse.setStudentID("fdfdfl");
		
		StudentBatchCourseMgtDAO studentBatchCourseMgtDAO = new StudentBatchCourseMgtDAOImpl();
		studentBatchCourseMgtDAO.insert(studentBatchCourse);*/
		Session session = ApplicationSession.getSession();
		session.beginTransaction();
		Query query = session.getNamedQuery("batch_student.insersion");
		query.setString(0, "0000");
		query.setString(1, "1111");
		session.getTransaction().commit();
		session.close();
	}

}
